linq get a dictionary key and value c#

55

linq get a dictionary key and value c# -

 var values = dictionary.Where(x => someKeys.Contains(x.Key)).Select(x => x.Value);
 var keys = dictionary.Where(x => someValues.Contains(x.Value)).Select(x => x.Key);

Comments

Submit
0 Comments